Skip to content

fix(combobox): keep the dropdown open while dragging its scrollbar - #6307

Merged
waleedlatif1 merged 2 commits into
stagingfrom
worktree-model-dropdown-scrollbar
Aug 6, 2026
Merged

fix(combobox): keep the dropdown open while dragging its scrollbar#6307
waleedlatif1 merged 2 commits into
stagingfrom
worktree-model-dropdown-scrollbar

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Grabbing a combobox dropdown's scrollbar closed the dropdown mid-drag (e.g. the agent block's Model field). The editable input's onBlur starts a 150ms timer that closes the dropdown unless focus is still inside it — option rows dodge that by preventing default on mousedown, but the list's native scrollbar doesn't, so pressing it parked focus on <body> and the dropdown dismissed itself.
  • Suppress that blur-close while a pointer press that started inside the popover is still held, and hand focus back to the input on release so typing and arrow keys keep working after a drag.
  • Editable-only and behavior-only: no prop, API, or styling change. Every Combobox-backed picker (ChipCombobox, ChipSelect, credential/tool/file selectors) inherits the fix.

Type of Change

  • Bug fix

Testing

Typecheck and lint pass. Not yet verified in the browser — worth a click-test on the Model dropdown (and a spot-check in Firefox/Safari, whose scrollbars behave differently).

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 6, 2026 3:21am

Request Review

@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Localized interaction fix in editable combobox blur/focus handling; no API, auth, or data-path changes.

Overview
Fixes editable Combobox dropdowns closing mid-drag when the user grabs the list’s native scrollbar (e.g. Model picker). Scrolling the list blurs the input and moves focus to <body>; the delayed handleBlur then treats that as leaving the combobox and dismisses the popover—unlike option rows, which prevent default on mousedown.

The change tracks an in-progress pointer press that started inside PopoverContent (onPointerDownCapture), skips the blur-close path while that flag is set, and on pointerup/pointercancel clears the flag and refocuses the input when focus isn’t already in a text field. Selecting an option clears the flag before blur so a following pointerup doesn’t refocus and reopen the menu.

No API or styling changes—behavior-only fix for editable comboboxes; other combobox-backed pickers inherit it.

Reviewed by Cursor Bugbot for commit f858231. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR keeps editable combobox dropdowns open while users drag the native scrollbar and restores input focus when the pointer is released.

  • Tracks pointer presses originating inside the dropdown.
  • Defers blur-driven closure until the press ends.
  • Clears pointer state during option selection to avoid reopening the dropdown.
  • Moves the focus-restoration rationale into TSDoc documentation.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported documentation issue is fixed at the current HEAD, and no blocking failure remains.

Important Files Changed

Filename Overview
packages/emcn/src/components/combobox/combobox.tsx Adds pointer-lifecycle handling for editable dropdown scrollbar drags and resolves the prior documentation-format feedback with TSDoc blocks.

Reviews (2): Last reviewed commit: "improvement(combobox): move pointer-pres..." | Re-trigger Greptile

Comment thread packages/emcn/src/components/combobox/combobox.tsx
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit f858231. Configure here.

@waleedlatif1
waleedlatif1 merged commit 79bfff7 into staging Aug 6, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the worktree-model-dropdown-scrollbar branch August 6, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant